﻿using System;

namespace com.foxmail.wyyuan1991.Assignment.Host
{
    public static class Reporter
    {
        public static void ReportNetwork(INetwork net)
        {
            Console.WriteLine("Network：");
            Console.WriteLine("-----------NODES-----------");
            foreach (INode n in net.NodeList)
            {
                Console.WriteLine("{0}", n.ToString());
            }
            Console.WriteLine("-----------ARCS-----------");
            Console.WriteLine("ID \t SNODE \t ENODE \t CAP.");
            foreach (IArc a in net.ArcList)
            {
                Console.WriteLine("{0}\t {1} \t {2} \t {3}", a.ID, a.SNode.ID, a.ENode.ID, a.Capacity);
            }
        }
        public static void ReportDemand(INetwork net, IDemand d)
        {
            Console.WriteLine("Demand：");
            Console.WriteLine("SNODE \t ENODE \t Num.");
            foreach (IDistributionOD w in d.ODFlowList)
            {
                Console.WriteLine("{0}\t {1} \t {2}", w.OrgNode, w.DesNode, w.Num);
            }

        }
        public static void ReportFlowPattern(INetwork net, IFlowPattern f)
        {
            Console.WriteLine("-----------Flow Pattern-----------");
            Console.WriteLine("ARC \t FLOW");
            foreach (IArc a in net.ArcList)
            {
                Console.WriteLine("{0} \t {1}", a.ID, f.getFlow(a));
            }
        }
    }
}
